from selenium.webdriver.common.by import By

class IndexPage:
    url = "http://192.168.0.102/cmrv0.5.1/v0.5.1/index.php?m=user&a=login"
    alert_success_locator = (By.CSS_SELECTOR, 'body > div.container > div.alert.alert-success')

    def __init__(self,driver):
        self.driver = driver

    def get_username(self):
        return self.driver.find_element(*self.alert_success_locator).text

    def open(self):
        self.driver.get(self.url)